package org.jwd.storage.aop;

import org.jwd.storage.aop.aspect.AuditAspect;
import org.jwd.storage.aop.dp.AuditScanner;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author vizz
 * @since 2022/5/20 17:49
 */
@Configuration
public class AuditAopConfig {


    @Bean
    @ConditionalOnProperty(value = "sprout.audit.impl-way",havingValue = "aop")
    public AuditAspect auditAspect(){
        return new AuditAspect();
    }

    @Bean
    @ConditionalOnProperty(value = "sprout.audit.impl-way",havingValue = "dp")
    public AuditScanner auditScanner(){
        return new AuditScanner();
    }

}
